'''
Created on Dec 5, 2010

@author: jackreilly
'''

from jettube.models import Song, User, Opinion, Station, Comment
from django.utils.simplejson import dumps

def getServiceURLS():
    return {'addrecommendedsong':'/addrecommendedsong',
            'stationrequestdecision':'/stationrequestdecision',
            'relatedsongs':'/relatedsongs',
            'googleregister':'/googleregister',
            'registeruser':'/registeruser',
            'whatis':'/whatis',
            'postcomment':'/postcomment',
            'getstationnames':'/getstationnames',
            'getcomments':'/getcomments',
            'addopinion':'/addopinion',
            'getsongids':'/getsongids',
            'addsong': '/addsong',
            'main' : '/',
            'requestedstations': '/requestedstations'
            }


def getKeyReferenceDictionary():
    # station
    stationKeys = {
                   'name':Station.NAME_KEY,
                   'owner':Station.OWNER_KEY,
                   'public':Station.PUBLIC_KEY,
                   'key':Station.KEY_KEY
                   }
    
    # opinion
    
    opinionKeys = {
                   'like':Opinion.LIKE_KEY,
                   'user':Opinion.USER_KEY ,
                   'songid':Opinion.SONG_ID_KEY
                   
                   }
    
    
    # song
    songKeys = {
                'songid':Song.SONG_ID_KEY,
                'likes':Song.LIKES_KEY,
                'dislikes':Song.DISLIKES_KEY,
                'title':Song.TITLE_KEY,
                'enabled':Song.ENABLED_KEY,
                'user':Song.USER_KEY,
                'station':Song.STATION_KEY,
                'key':Song.KEY_KEY,
                'comment':Song.COMMENT_KEY,
                'opinion':Song.OPINION_KEY            
                }
    
    
    # user
    userKeys = {
                'id':User.USER_ID_KEY,
                'type':User.USER_TYPE_KEY,
                'noneuser':User.NONE_USER_TYPE,
                'picUrl':User.PIC_KEY,
                'user':User.NAME_KEY,
                'key':User.KEY_KEY,
                'requestedStations': User.REQUESTED_STATIONS_KEY,
                'stations': User.STATIONS_KEY,
                'blockedStations': User.BLOCKED_STATIONS_KEY,
                }
                
    
    # comments
    commentKeys = {
    'songid':Comment.SONG_ID_KEY,
    'comment':Comment.COMMENT_KEY,
    'key':Comment.KEY_KEY,
    'poster':Comment.POSTER_KEY,
    'date':Comment.DATE_KEY
    }
    
    keyReference = {
                    'comments':commentKeys,
                    'users': userKeys,
                    'opinions': opinionKeys,
                    'stations':stationKeys,
                    'songs': songKeys
                    }
    
#    for k,v in keyReference.iteritems():
#        for kk,vv in v.iteritems():
#            keyReference[k][kk]+=k

    return keyReference